<?php

use \Welcomescreen\Agavi\Action;
use \Welcomescreen\Objects;

class Backend_Users_AddAction extends Action\BackendBaseAction {

	/**
	 * @param AgaviRequestDataHolder $rd
	 * @return string
	 */
	public function executeWrite(\AgaviRequestDataHolder $rd) {
		$user = new Objects\User($rd->getParameter('username'), $rd->getParameter('password'), false);
		$this->getContext()->getModel('UserManager')->addUser($user);
		$this->setAttribute('user', $user);
		return 'Success';
	}

}

?>